Computer users typically use user agent applications such as web browsers to access documents and other resources that are available over a computer network, e.g., the World Wide Web. Resources available on the World Wide Web (also referred to simply as “the Web”) are generally stored in documents called web pages. Such web pages are identified by a Uniform Resource Identifier (URI), usually a Uniform Resource Locator (URL), which identifies the web page uniquely and provides the information necessary for locating and accessing the web page.
A web browser is a computer program that, when executed on a client computer, enables the client computer to read and display web pages. A web browser includes a user interface component for addressing a particular server on a network, and designating a particular document (e.g., a web page) to be obtained from the addressed server. Using the Hypertext Transfer Protocol (HTTP), a web browser may fetch the designated documents from the server. Also, a web browser includes a component for displaying the content of web pages.
In particular, web browsers are operable to display the content of web pages, which are formatted as markup language documents. “Markup language document” generally refers to a text file that includes “markup tags.” In particular, markup tags tell the web browser how to display the web page. Such tags are used to define hypertext links, specify format changes, or otherwise indicate how particular elements in the web page should be displayed. Examples of markup language documents are Hypertext Markup Language (HTML), extensible Hypertext Markup Language (XHTML), and extensible Markup Language (XML) documents.
Cascading Style Sheet or Cascading Style Sheets (CSS) is a language used to describe the presentation style (e.g. fonts, colors, spacing) of a document written in a markup language (ML). Rule sets, or rules, consisting of selectors and declaration blocks, are used to determine how styles should be applied. In CSS, selectors are used to declare which of the markup elements a style applies to, while declaration blocks are used to declare the style. An example of a rule is                h1{color: green }where “h1” is the selector and {color: green } is the declaration block. The selector indicates that all elements that are H1 elements (i.e. headings) match this rule, and the declaration block declares that matching elements (H1 headings) should be rendered as green.        
Currently, CSS selectors may be parsed into a data structure of e.g. linked lists. This data structure is traversed during selector matching along with the Document Object Model (DOM) to match selectors against DOM nodes or elements. For m DOM nodes or elements and n CSS selectors, m×n matches may typically be required. The result of the matching may be that the DOM node or element is shown in a web browser with the style described by the matched selector.
CSS selector matching is currently a major bottleneck in web browsers in general, and CSS stylesheets tend to be increasingly large on real web sites.
Alternatives to make CSS selector matching faster is to more effectively prune selectors that cannot possibly match a given DOM element.